//
//  UIImage+EXUIImage.m
//  Exercise
//
//  Created by 羊谦 on 16/5/31.
//  Copyright © 2016年 NetEase-yangqian. All rights reserved.
//

#import "UIImage+EXUIImage.h"

@implementation UIImage (EXUIImage)

+(UIImage *)imageWithColor:(UIColor *)color{
    if (!color)
    {
        return nil;
    }
    CGRect rect = CGRectMake(0, 0, 1, 1);
    // Create a 1 by 1 pixel context
    UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
    [color setFill];
    UIRectFill(rect); // Fill it with your color
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return image;

}

@end
